package biometria.client.service;

import biometria.shared.User;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("login")
public interface LoginService extends RemoteService {

    /**
     * Utility class for simplifying access to the instance of async service.
     */
    public static class Util {
        
    	private static LoginServiceAsync instance;
 
        public static LoginServiceAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(LoginService.class);
            }
            return instance;
        }
    }
 
    User loginServer(String name, String password);
 
    User loginFromSessionServer();
     
    Boolean changePassword(String name, String newPassword);
 
    void logout();
}